package org.paradise.dms.web.tools;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.apache.log4j.Logger;
import org.springframework.util.ClassUtils;
import org.springframework.util.SystemPropertyUtils;
import org.springframework.web.context.support.WebApplicationContextUtils;

/**
 * 
 * Description:用于处理在开机的过程中就要启动的业务
 * 
 * Copyright (c) 2008-2009 paraDise sTudio(DT). All Rights Reserved.
 * 
 * @version 1.0 2009-3-20 下午09:52:03 李双江（paradise.lsj@gmail.com）created
 */
public class InitiaServlet extends HttpServlet {

	protected Logger log = Logger.getLogger(InitiaServlet.class);

	private static final long serialVersionUID = 8550329576989690578L;

	public InitiaServlet() {
		super();
	}

	public void destroy() {
		super.destroy();
	}

	protected String resolveBasePackage(String basePackage) {
		return ClassUtils.convertClassNameToResourcePath(SystemPropertyUtils.resolvePlaceholders(basePackage));
	}

	public void init() throws ServletException {
		ServerConfig.setBeanFacotry(WebApplicationContextUtils.getWebApplicationContext(this.getServletContext()));
	}

}
